package pl.plesken.tools;

import java.io.File;
import java.util.LinkedList;

public class ListXMLFiles {
        LinkedList<String> file = new LinkedList<String>();


        public LinkedList<String> getFile() {
                return file;
        }

        public void setFile(LinkedList<String> file) {
                this.file = file;
        }


        public void list(String dir) {
                File f = new File(dir + File.separator);
                
                if (f.exists() && f.isDirectory()) {
                        String[] files = f.list();
                        for (int i = 0; i < files.length; i++) {                
                                File test = new File(dir + File.separator + files[i]);
                                if (test.isFile()) {
                                        if (files[i].endsWith(".xml") && !files[i].contains("Title_") && !files[i].contains("Year_") && !files[i].contains("Other_") && !files[i].contains("Genres_") && !files[i].contains("Categories") && !files[i].contains("categories") && !files[i].contains("Rating_")) {
                                                file.add(files[i]);
                                        } 
                                }
                        } 
                }
        }

                
}
